#ifndef __ENGINE_PACKAGE_FACTORY_included
#define __ENGINE_PACKAGE_FACTORY_included

#include <istream>
#include "Request.h"

namespace Engine {

class CRequestAllocator {
public :
	virtual boost::shared_ptr<CRequest> alloc(std::string& cmd, boost::shared_ptr<std::istream> is) = 0;
	virtual boost::shared_ptr<CRequest> alloc(std::string& cmd, boost::asio::streambuf& data) = 0;
};

class CPackageFactory {
	
public :
	static boost::shared_ptr<CPackage> Parse(boost::asio::streambuf& data, CRequestAllocator* allocator);
	static boost::shared_ptr<CPackage> Parse(boost::shared_ptr<std::istream> is, CRequestAllocator* allocator);
};
}
#endif // __ENGINE_PACKAGE_FACTORY_included